// 测试权限系统的简单脚本
import { useUserStore } from '@/stores/user';

// 创建用户存储实例
const userStore = useUserStore();

// 测试权限检查
console.log('测试权限系统:');
console.log('qrcode:create:', userStore.hasPermission('qrcode:create'));
console.log('qrcode:update:', userStore.hasPermission('qrcode:update'));
console.log('qrcode:delete:', userStore.hasPermission('qrcode:delete'));
console.log('qrcode:view:', userStore.hasPermission('qrcode:view'));

// 测试设置权限后的情况
userStore.setPermissions(['qrcode:create', 'qrcode:view']);
console.log('设置权限后:');
console.log('qrcode:create:', userStore.hasPermission('qrcode:create'));
console.log('qrcode:update:', userStore.hasPermission('qrcode:update'));
console.log('qrcode:delete:', userStore.hasPermission('qrcode:delete'));
console.log('qrcode:view:', userStore.hasPermission('qrcode:view'));